package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLList;
import HLLib.base.HLString;
import HLLib.purchase.HLPurchase;
import HLLib.purchase.HLTransaction;

public class HLClassPurchase extends HLLibClass {
    public HLClassPurchase(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLPurchase();
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            HLPurchase.GetProducts((HLList)args.GetObject(0));
            break;
        }
        case 1: {
            HLPurchase.PayProduct((HLString)args.GetObject(0), args.GetInt(0));
            break;
        }
        case 2: {
            HLPurchase.PayProductNet((HLString)args.GetObject(0), args.GetInt(0));
            break;
        }
        case 3: {
            HLPurchase.FinishPay((HLTransaction)args.GetObject(0));
            break;
        }
        case 4: {
            HLPurchase.StartObservePuerchase();
            break;
        }
        case 5: {
            HLPurchase.Restore();
            break;
        }
        case 6: {
            HLPurchase.Check((HLTransaction)args.GetObject(0));
            break;
        }
        }
    }
}
